$(function () {

    var fn = ABUS.Fn;
    var $el = $('#selectAddress');

    document.addEventListener('touchmove', function (e) { e.preventDefault();},  { passive: false } );
    var myScroll = new IScroll('#selectAddress', { mouseWheel: true });

    $el.find('.default').on('touchend', function () {
        $(this).addClass('selected');
        $(this).parents('li').siblings().find('.default').removeClass('selected');
    });

    $el.find('.delete').on('touchend', function () {
        var index = $(this).parents('li').index();
        fn.delete({
            template: '\
             <div class="whether_delete">\
             <div class="delete_top">\
             <div class="delete_top_1">\
             <span class="font30 color666">您确认要删除吗？</span>\
             </div>\
             </div>\
             <div class="delete_bottom">\
             <div class="delete_bottom_left" data-cancel-btn>\
             <span class="font28 color666">取消</span>\
             </div>\
             <div class="delete_bottom_right" data-submit-btn>\
             <span class="font28 colorfff">确认</span>\
             </div>\
             </div>\
             </div>',

            onSubmit: function () {
                $('#addressList li').eq(index).remove();
                fn.closeModal()
            },
            onCancel: function () {
                fn.closeModal()
            }

        })
    })
});
